package com.my.bean;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import java.io.Serializable;
import java.util.List;
import java.util.Set;

/**
 * <p>
 *
 * </p>
 *
 * @author 张子艺
 * @since 2018-08-25
 */
@TableName("user")
public class User extends Model<User> {

	private static final long serialVersionUID = 1L;

	private Long id;
	/**
	 * 用户名
	 */
	private String username;
	/**
	  * 密码
	 */
	private String password;
	/**
	 * 添加时间
	 */
	@TableField("create_time")
	private Long createTime;
	/**
	 * 区域ID
	 */
	@TableField("area_id")
	private long areaId;


	/**
	 * 指定人可以添加房间
	 */
	private String appoint;

	public String getAppoint() {
		return appoint;
	}

	public void setAppoint(String appoint) {
		this.appoint = appoint;
	}

	//该注解表示表中不存在该字段 调用新增时 不会自动映射新增该字段
	@TableField(exist = false)
	private  Role  roles;
	@TableField(exist = false)
	private  String  roleName;

	public Long getAreaId() {
		return areaId;
	}

	public void setAreaId(Long areaId) {
		this.areaId = areaId;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName.trim();
	}

	public Role getRoles() {
		return roles;
	}

	public void setRoles(Role roles) {
		this.roles = roles;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Long getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Long createTime) {
		this.createTime = createTime;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}

	@Override
	public String toString() {
		return "User{" +
				"id=" + id +
				", username='" + username + '\'' +
				", password='" + password + '\'' +
				", createTime=" + createTime +
				", areaId=" + areaId +
				", roles=" + roles +
				", roleName='" + roleName + '\'' +
				", appoint='" + appoint + '\'' +
				'}';
	}
}
